﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Police/Police.master" AutoEventWireup="true"
    StylesheetTheme="Content" CodeFile="SoldierSelect.aspx.cs" Inherits="BasicBase_SoldierArchive_SoldierSelect" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script type="text/javascript">
        function print() {
            window.open('Print.aspx');

        }
        function OpenWin(url) {
            var h = 480;
            var w = 640;
            var t = (screen.height - h) / 2;
            var l = (screen.width - w) / 2;
            window.open(url, null, 'left=' + l + ",top=" + t + ",width=" + w + ",height=" + h + ",toolbar=yes,scrollbars=yes,status=yes");
        }
    </script>

    <style type="text/css">
        .style1
        {
            height: 11px;
        }
        .style2
        {
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table border="0" cellpadding="4" cellspacing="0" width="100%" style="text-align: left">
        <caption>
            <span>查询条件设定</span></caption>
        <tr>
            <td>
                姓名：
            </td>
            <td class="style2">
                <asp:TextBox ID="SoldierName" runat="server" Width="153px"></asp:TextBox>
            </td>
            <td>
                性别：
            </td>
            <td>
                <asp:DropDownList ID="ddlSex" runat="server" Width="180px">
                    <asp:ListItem></asp:ListItem>
                    <asp:ListItem>男</asp:ListItem>
                    <asp:ListItem>女</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                出生日期：
            </td>
            <td class="style2">
                <asp:DropDownList ID="ddlBirthOperater" runat="server" Width="75px">
                    <asp:ListItem Value="=">等于</asp:ListItem>
                    <asp:ListItem Value="&gt;">大于</asp:ListItem>
                    <asp:ListItem Value="&lt;">小于</asp:ListItem>
                    <asp:ListItem Value="&gt;=">大于等于</asp:ListItem>
                    <asp:ListItem Value="&lt;=">小于等于</asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox ID="Birthday" runat="server" Width="75px"></asp:TextBox>
            </td>
            <td width="60px">
                文化程度：
            </td>
            <td>
                <asp:DropDownList ID="ddlCulture" runat="server" Width="180px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td width="60px">
                政治面貌：
            </td>
            <td>
                <asp:DropDownList ID="ddlPolitical" runat="server" Width="180px">
                </asp:DropDownList>
            </td>
            <td>
                特长：
            </td>
            <td>
                <asp:DropDownList ID="ddlHobby" runat="server" Width="180px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td width="60px">
                单位：
            </td>
            <td>
                <asp:DropDownList ID="ddlSection" runat="server" Width="180px" DataTextField="FullName"
                    DataValueField="DepartmentId">
                </asp:DropDownList>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style1">
                籍贯：
            </td>
            <td class="style1" colspan="3">
                <ajaxToolkit:CalendarExtender ID="ceBirth" runat="server" Animated="False" Enabled="True"
                    Format="yyyy-MM-dd" TargetControlID="Birthday">
                </ajaxToolkit:CalendarExtender>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:DropDownList ID="ddlProvinces" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlProvinces_SelectedIndexChanged"
                            Width="180px">
                        </asp:DropDownList>
                        <asp:DropDownList ID="ddlCities" runat="server" Width="180px">
                        </asp:DropDownList>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="ddlProvinces" EventName="SelectedIndexChanged" />
                    </Triggers>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td align="left" colspan="2">
                <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="查询" />
                &nbsp;
                <asp:Button ID="export" runat="server" OnClick="export_Click" Text="导出EXCEL"></asp:Button>
            </td>
        </tr>
    </table>
    <asp:Label runat="server" ID="lblUpdataResult"></asp:Label>
    <asp:UpdatePanel ID="upResult" runat="server">
        <ContentTemplate>
            <%--<div style="height:400px;width:750px;OVERFLOW-Y: auto; overflow-x:auto;margin-top:10px; text-align:center; ">--%>
            <asp:Panel ID="PanelList" runat="server">
                <asp:GridView ID="gvSoldiers" runat="server" AutoGenerateColumns="False" Caption="<span>兵员查询</span>"
                    DataKeyNames="SoldierID,DepartmentID" OnRowDeleting="gvSoldiers_RowDeleting"
                    Width="98%" OnRowDataBound="gvSoldiers_RowDataBound">
                    <Columns>
                        <asp:TemplateField ItemStyle-HorizontalAlign="Left">
                            <HeaderStyle Width="30px" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:Label ID="ID" runat="server" ForeColor="#666666"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="姓名">
                            <ItemTemplate>
                                <a runat="server" target="_blank" id="AName"></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="DepartmentName" HeaderText="单位" />
                        <asp:BoundField DataField="RankName" HeaderText="警衔" />
                        <asp:BoundField DataField="NativeName" HeaderText="籍贯" />
                        <asp:TemplateField HeaderText="入伍年月">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Convert.ToDateTime(Eval("JoinTime")).Year==9999?"--":Convert.ToDateTime(Eval("JoinTime"))==DateTime.MinValue?"--": Convert.ToDateTime(Eval("JoinTime")).ToString("yyyy.MM") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="编辑" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:ImageButton runat="server" ID="btnEdit" ImageUrl="../../Images/Edit.gif" ToolTip="编辑" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="20px" HeaderText="删除" HeaderStyle-Width="24px"
                            ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:ImageButton ID="delteImage" ToolTip="删除" ImageUrl="~/Images/delete.gif" OnClientClick="return confirm('您确认删除此兵员记录吗？')"
                                    CommandName="Delete" runat="server" CausesValidation="false" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle HorizontalAlign="Left" />
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:GridView>
                <asp:Panel Width="100%" runat="server" ID="panPage" Visible="false">
                    <div style="padding: 4px;">
                        <div style="float: left">
                            <asp:Label ID="lbGridInfo" runat="server"></asp:Label>
                        </div>
                        <div style="float: right">
                            <asp:LinkButton ID="btnFirst" runat="server" CommandArgument="First" CommandName="Page"
                                OnClick="btnFirst_Click">首页</asp:LinkButton>
                            <asp:LinkButton ID="btnPrev" runat="server" CommandArgument="Prev" CommandName="Page"
                                OnClick="btnPrev_Click">上一页</asp:LinkButton>
                            <asp:LinkButton ID="btnNext" runat="server" CommandArgument="Next" CommandName="Page"
                                OnClick="btnNext_Click">下一页</asp:LinkButton>
                            <asp:LinkButton ID="btnLast" runat="server" CommandArgument="Last" CommandName="Page"
                                OnClick="btnLast_Click">末页</asp:LinkButton>
                            转到：第
                            <asp:DropDownList ID="JumpList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="JumpList_SelectedIndexChanged">
                            </asp:DropDownList>
                            页
                        </div>
                    </div>
                </asp:Panel>
                <asp:Label runat="server" ID="lblWhere" Visible="False"></asp:Label>
                <asp:HiddenField ID="strSql" runat="server" />
                <asp:HiddenField ID="strPrmission" runat="server" />
                <asp:HiddenField ID="strName" runat="server" />
                <%-- </div>--%></asp:Panel>
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
